home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 3.iso / dist / fw_qt3.idb / usr / freeware / Qt / examples / demo / textdrawing / textedit.h.z / textedit.h
Encoding:
C/C++ Source or Header  |  2002-04-08  |  1.8 KB  |  87 lines

  1. /****************************************************************************
  2. ** $Id:  qt/textedit.h   3.0.3   edited Oct 12 12:18 $
  3. **
  4. ** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
  5. **
  6. ** This file is part of an example program for Qt.  This example
  7. ** program may be used, distributed and modified without limitation.
  8. **
  9. *****************************************************************************/
  10.  
  11. #ifndef TEXTEDIT_H
  12. #define TEXTEDIT_H
  13.  
  14. #include <qmainwindow.h>
  15. #include <qmap.h>
  16.  
  17. class QAction;
  18. class QComboBox;
  19. class QTabWidget;
  20. class QTextEdit;
  21.  
  22. class TextEdit : public QMainWindow
  23. {
  24.     Q_OBJECT
  25.  
  26. public:
  27.     TextEdit( QWidget *parent = 0, const char *name = 0 );
  28.  
  29.     QTextEdit *currentEditor() const;
  30.     void load( const QString &f );
  31.  
  32.  
  33. public slots:
  34.     void fileNew();
  35.     void fileOpen();
  36.     void fileSave();
  37.     void fileSaveAs();
  38.     void filePrint();
  39.     void fileClose();
  40.     void fileExit();
  41.  
  42.     void editUndo();
  43.     void editRedo();
  44.     void editCut();
  45.     void editCopy();
  46.     void editPaste();
  47.  
  48.     void textBold();
  49.     void textUnderline();
  50.     void textItalic();
  51.     void textFamily( const QString &f );
  52.     void textSize( const QString &p );
  53.     void textStyle( int s );
  54.     void textColor();
  55.     void textAlign( QAction *a );
  56.  
  57.     void fontChanged( const QFont &f );
  58.     void colorChanged( const QColor &c );
  59.     void alignmentChanged( int a );
  60.     void editorChanged( QWidget * );
  61.  
  62.  
  63. private:
  64.     void setupFileActions();
  65.     void setupEditActions();
  66.     void setupTextActions();
  67.     void doConnections( QTextEdit *e );
  68.  
  69.     QAction *actionTextBold,
  70.     *actionTextUnderline,
  71.     *actionTextItalic,
  72.     *actionTextColor,
  73.     *actionAlignLeft,
  74.     *actionAlignCenter,
  75.     *actionAlignRight,
  76.     *actionAlignJustify;
  77.     QComboBox *comboStyle,
  78.     *comboFont,
  79.     *comboSize;
  80.     QTabWidget *tabWidget;
  81.     QMap<QTextEdit*, QString> filenames;
  82.  
  83. };
  84.  
  85.  
  86. #endif
  87.